import { IPSDEDataQueryCode } from './ipsdedata-query-code';
import { IPSDEDataQueryCodeCond } from './ipsdedata-query-code-cond';
import { IPSDEDataQueryCodeExp } from './ipsdedata-query-code-exp';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEDataQueryCodeImpl extends PSModelObjectImpl implements IPSDEDataQueryCode {
  get codeName(): string {
    return this.M.codeName;
  }

  get dBType(): 'DB2' | 'MYSQL5' | 'ORACLE' | 'SQLSERVER' | 'POSTGRESQL' | 'PPAS' | 'SQLITE' | 'DM' | 'HANA' {
    return this.M.dBType;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  protected psdedataquerycodeconds: IPSDEDataQueryCodeCond[] | null = null;

  getPSDEDataQueryCodeConds(): IPSDEDataQueryCodeCond[] | null {
    if (this.psdedataquerycodeconds == null) {
      this.psdedataquerycodeconds = this.fillChildListModel(this.M.getPSDEDataQueryCodeConds, 'dataentity.ds.IPSDEDataQueryCodeCond') as IPSDEDataQueryCodeCond[];
    }
    return this.psdedataquerycodeconds;
  }

  get psDEDataQueryCodeConds(): IPSDEDataQueryCodeCond[] | null {
    return this.getPSDEDataQueryCodeConds();
  }

  findPSDEDataQueryCodeCond(objKey: any): IPSDEDataQueryCodeCond | null {
    return this.getPSModel5('dataentity.ds.IPSDEDataQueryCodeCond', this.getPSDEDataQueryCodeConds(), objKey) as IPSDEDataQueryCodeCond;
  }

  protected psdedataquerycodeexps: IPSDEDataQueryCodeExp[] | null = null;

  getPSDEDataQueryCodeExps(): IPSDEDataQueryCodeExp[] | null {
    if (this.psdedataquerycodeexps == null) {
      this.psdedataquerycodeexps = this.fillChildListModel(this.M.getPSDEDataQueryCodeExps, 'dataentity.ds.IPSDEDataQueryCodeExp') as IPSDEDataQueryCodeExp[];
    }
    return this.psdedataquerycodeexps;
  }

  get psDEDataQueryCodeExps(): IPSDEDataQueryCodeExp[] | null {
    return this.getPSDEDataQueryCodeExps();
  }

  findPSDEDataQueryCodeExp(objKey: any): IPSDEDataQueryCodeExp | null {
    return this.getPSModel5('dataentity.ds.IPSDEDataQueryCodeExp', this.getPSDEDataQueryCodeExps(), objKey) as IPSDEDataQueryCodeExp;
  }

  get queryCode(): string {
    return this.M.queryCode;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get cls(): string {
    return 'PSDEDataQueryCodeImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dataentity.ds.IPSDEDataQueryCode') return true;
    return super.instanceof(cls);
  }
}
